//
//  CWQ_imageLabel.m
//  BaxTer
//
//  Created by 陈武琦 on 16/9/1.
//  Copyright © 2016年 陈武琦. All rights reserved.
//

#import "CWQ_imageLabel.h"
#import "UIImageView+BTimageView.h"
@implementation CWQ_imageLabel
- (void)awakeFromNib {
    [super awakeFromNib];
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(click)];
    [self addGestureRecognizer:tap];
}

+ (CWQ_imageLabel *)imageLabel {

   CWQ_imageLabel *view =  [[NSBundle mainBundle] loadNibNamed:@"CWQ_imageLabel" owner:nil options:0].lastObject;
    return view;
}

- (void)setModel:(BTHistoryCourseM *)model {
    _model = model;
    self.title.text = model.courseName;
    [self.icon bt_setImageWithUrl:model.courseImage];
}

- (void)click {

    if ([_delegate respondsToSelector:@selector(cwq_imageLabel:mode:)]) {
        [_delegate cwq_imageLabel:self mode:self.model];
    }

}

@end
